package com.mork;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mork.mail.SendEmailText;

@SpringBootApplication
@RestController
public class SpringApplicationEmailMain {

	@Autowired
	SendEmailText sendEmailText;

	public static void main(String[] args) {
		SpringApplication.run(SpringApplicationEmailMain.class, args);
	}

	@GetMapping("/send")
	public String send() {

		String sender = "137813831@qq.com"; // 这个是发送人的邮箱
		String receiver = "493344211@qq.com"; // 这个是接受人的邮箱
		String title = "66万漏油奔驰"; // 标题
		String text = "【坐在引擎盖上哭】“　66万买辆奔驰,还没开出店门就漏油,请问这种车去哪里买呢,我也想要一辆。";

		String result = sendEmailText.send(sender, receiver, title, text);
		System.out.println("发送成功!");
		return result;
	}
}
